//
//  ZYNavigationView.m
//  YiLin
//
//  Created by Zyark on 2018/5/30.
//  Copyright © 2018年 Zyark. All rights reserved.
//

#import "ZYNavigationView.h"

@interface ZYNavigationView()
//@property(nonatomic,strong) UIView *bgView;
@property(nonatomic,strong) UIView *bottomView;
@end

@implementation ZYNavigationView

-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self setUp];
    }
    return self;
}

-(void)setUp{
    UIView *gbView = [[UIView alloc] initWithFrame:self.bounds];
    [ZYUtils setGradualChangingColor:gbView];//设置背景颜色渐变
    UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.width, 35)];
    [view setBackgroundColor:[UIColor whiteColor]];
    [self addSubview:gbView];
    [gbView addSubview:view];
    view.bottom = gbView.bottom + view.height / 2;
    view.layer.cornerRadius = view.height / 2;
    view.layer.masksToBounds = YES;
    gbView.clipsToBounds = YES;
    _bottomView = view;
}

-(void)setBottomViewBgColor:(UIColor *)color{
    _bottomView.backgroundColor = color;
}
@end
